package com.longxi.tianjintianbao.ui.fragment.mian;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.activity.main.MainActivity;
import com.longxi.tianjintianbao.ui.base.LazyFragment;
import com.longxi.tianjintianbao.ui.presenter.main.MeFgPresenter;
import com.longxi.tianjintianbao.ui.view.main.IMeFgView;

import butterknife.BindView;

/**
 * @创建者 Kuma
 * @描述 消息
 */
public class MeFragment extends LazyFragment<IMeFgView, MeFgPresenter> implements IMeFgView {

    private final String TAG = "MessageFragment";

    @BindView(R.id.tvBarTitle)
    TextView mTvBarTitle;

    @BindView(R.id.tvUsername)
    TextView mTvUsername;

    @BindView(R.id.tvCompanyName)
    TextView mTvCompanyName;

    @BindView(R.id.tvCommunityName)
    TextView mTvCommunityName;

    @BindView(R.id.tvPostName)
    TextView mTvPostName;

    @BindView(R.id.tvInTime)
    TextView mTvInTime;

    @BindView(R.id.rlLoginOut)
    RelativeLayout mRlLoginOut;

    @BindView(R.id.rlCommunity)
    RelativeLayout mRlCommunity;

    @BindView(R.id.rlPersonalData)
    RelativeLayout mRlPersonalData;

    @BindView(R.id.rlPostName)
    RelativeLayout mRlPostName;

    @BindView(R.id.rlWorkLayout)
    RelativeLayout mRlWorkLayout;

    @BindView(R.id.rlAboutMe)
    RelativeLayout mRlAboutMe;

    @BindView(R.id.rlWidget)
    RelativeLayout mRlWidget;

    @Override
    protected void init(View view) {
        setTitle("我的");
        mPresenter.meUi();
        mRlLoginOut.setOnClickListener(v -> mPresenter.loginOut());
        mRlCommunity.setOnClickListener(v ->mPresenter.toSelectCommunityActivity());
        mRlPersonalData.setOnClickListener(v -> mPresenter.toPersonalDataActivity());
        mRlPostName.setOnClickListener(v -> mPresenter.OneButtonDialog("部门暂时不能修改"));
        mRlWorkLayout.setOnClickListener(v -> mPresenter.toWorkLayoutActivity());
        mRlAboutMe.setOnClickListener(v -> mPresenter.toAboutActivity());
//        mRlWidget.setOnClickListener(v -> mPresenter.toMyWidgetTest());
    }

    @Override
    protected MeFgPresenter createPresenter() {
        return new MeFgPresenter((MainActivity) getActivity());
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    @Override
    protected int provideContentViewId() {
        return R.layout.fragment_me;
    }

    @Override
    public TextView getTvBarTitle() {
        return mTvBarTitle;
    }

    @Override
    public TextView getTvUsername() {
        return mTvUsername;
    }

    @Override
    public TextView getTvCompanyName() {
        return mTvCompanyName;
    }

    @Override
    public TextView getCommunityName() {
        return mTvCommunityName;
    }

    @Override
    public TextView getPostName() {
        return mTvPostName;
    }

    @Override
    public TextView getInTime() {
        return mTvInTime;
    }

    @Override
    public RelativeLayout getRlPersonalData() {
        return mRlPersonalData;
    }

    @Override
    public RelativeLayout getRlLoginOut() {
        return mRlLoginOut;
    }

    public void meUi(){
        mPresenter.meUi();
    }
}

